﻿@{
    ViewBag.Title = "EditImg";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
@model UploadFileModel
<div class="row-fluid" style="margin-top: 5px">
    <div class="span24 span-first">
        <form class="form-horizontal" enctype="multipart/form-data" method="post" action="/Admin/FileUpload/EditImg">
            <div class="control-group">
                <label class="control-label">图片来源：</label>
                <div class="controls">
                    @Html.RadioButtonFor(x => x.Source, 10, new { @checked = "checked" })本地图片 @Html.RadioButtonFor(x => x.Source, 20)网络图片 
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">图片地址：</label>
                <div class="controls">
                    <input type="file" name="file" id="file" style="width: 385px" />
                    <input type="text" name="FileUrl" id="fileUrl" style="width: 377px; display: none" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">图片名称：</label>
                <div class="controls">
                    @Html.TextBoxFor(x => x.FileName)
                    @Html.HiddenFor(x => x.ID)
                    @Html.HiddenFor(x => x.FileID)
                    @Html.HiddenFor(x => x.CallBack)
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" style="height: 77px">图片说明：</label>
                <div class="controls" style="height: 77px">
                    @Html.TextAreaFor(x => x.Remark, new { style = "width:376px;height:65px" })
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">排序：</label>
                <div class="controls">
                    @Html.TextBoxFor(x => x.Sort)
                </div>
            </div>
            <hr>
            <div style="text-align: center">
                <button class="button button-primary" type="submit">提交</button>
                <button class="button" type="reset" onclick="parent.CloseWin()">取消</button>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    $('input[type=radio]').click(function () {
        if ($(this).val() == '10') {
            $('#file').show();
            $('#fileUrl').hide();
        } else {
            $('#file').hide();
            $('#fileUrl').show();
        }
    })
</script>

